unit UMain2;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, cxGraphics, cxControls,
  cxLookAndFeels, cxLookAndFeelPainters, dxRibbonSkins, dxSkinsCore,
  dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee,
  dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
  dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast,
  dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
  dxSkinMcSkin, dxSkinMoneyTwins, dxSkinOffice2007Black, dxSkinOffice2007Blue,
  dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver,
  dxSkinOffice2010Black, dxSkinOffice2010Blue, dxSkinOffice2010Silver,
  dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
  dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
  dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010,
  dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinsdxRibbonPainter, cxClasses,
  dxRibbon, AdvToolBar, UAddPerson, Vcl.ImgList, test, UAddPersonell, UAddPatient, UDoctorList,
  UAddPersonRole, UAddTestType,UDepartment, UInsurance, URooms,UWard, UAddCareTypeMeasurement,
  UAddClassCareInsurance, UAddDischargeType, UNursingWards, UNurseList, UAddItem, UAssignCoefToItem,
  UAssignItemInsurancePricing, UAddLabItems, ULabTestRequest, UTestPricing, UAddDoctorPerc, UAddCategory,
  UItemInsuranceCoverage, UAddCoeff, UCurrencies, ULabTestResult, URadiologyRequest,UPharmacyLocation,
  USuppliers, UPharmacyLigne, UPharmacyCategories, AdvToolBarStylers,
  dxSkinsdxNavBarPainter, dxNavBarBase, dxNavBarCollns, dxNavBar,
  System.Actions, Vcl.ActnList, Vcl.PlatformDefaultStyleActnCtrls,
   Vcl.ActnMan, UPharmacyStock, UPharmacyStockSubNew, UPharmacyInvoice, UPharmacyTransaction,
   UPharmacyOptions, UDMSettings, UDMPerson, frxClass, frxDBSet, UDMLab, URadiologyTestResult, UItemAssignToPatient;

type
  TFMain2 = class(TForm)
    AdvToolBarOfficeStyler1: TAdvToolBarOfficeStyler;
    his_lab_price: TfrxDBDataset;
    his_pharmacy_price: TfrxDBDataset;
    ReInvoice: TfrxReport;
    care_encounter: TfrxDBDataset;
    his_encounter_all_info: TfrxDBDataset;
    ReEncounter: TfrxReport;
    his_radio_price: TfrxDBDataset;
    his_item_price: TfrxDBDataset;
    AdvToolBarPager1: TAdvToolBarPager;
    PharmacyPage: TAdvPage;
    AdvToolBar34: TAdvToolBar;
    AdvToolBar35: TAdvToolBar;
    AdvToolBar36: TAdvToolBar;
    AdvToolBar37: TAdvToolBar;
    procedure AdvToolBar1Click(Sender: TObject);
    procedure AdvToolBar2Click(Sender: TObject);
    procedure AdvToolBar3Click(Sender: TObject);
    procedure AdvToolBar4Click(Sender: TObject);
    procedure AdvToolBar6Click(Sender: TObject);
    procedure AdvToolBar7Click(Sender: TObject);
    procedure AdvToolBar8Click(Sender: TObject);
    procedure AdvToolBar9Click(Sender: TObject);
    procedure AdvToolBar10Click(Sender: TObject);
    procedure AdvToolBar11Click(Sender: TObject);
    procedure AdvToolBar12Click(Sender: TObject);
    procedure AdvToolBar13Click(Sender: TObject);
    procedure AdvToolBar14Click(Sender: TObject);
    procedure AdvToolBar15Click(Sender: TObject);
    procedure AdvToolBar5Click(Sender: TObject);
    procedure AdvToolBar16Click(Sender: TObject);
    procedure AdvToolBar17Click(Sender: TObject);
    procedure AdvToolBar18Click(Sender: TObject);
    procedure AdvToolBar20Click(Sender: TObject);
    procedure AdvToolBar21Click(Sender: TObject);
    procedure AdvToolBar19Click(Sender: TObject);
    procedure AdvToolBar23Click(Sender: TObject);
    procedure AdvToolBar24Click(Sender: TObject);
    procedure AdvToolBar25Click(Sender: TObject);
    procedure AdvToolBar26Click(Sender: TObject);
    procedure AdvToolBar27Click(Sender: TObject);
    procedure AdvToolBar28Click(Sender: TObject);
    procedure AdvToolBar22Click(Sender: TObject);
    procedure AdvToolBar29Click(Sender: TObject);
    procedure AdvToolBar33Click(Sender: TObject);
    procedure AdvToolBar34Click(Sender: TObject);
    procedure AdvToolBar35Click(Sender: TObject);
    procedure AdvToolBar36Click(Sender: TObject);
    procedure AdvToolBar37Click(Sender: TObject);
    procedure AdvToolBar30Click(Sender: TObject);
    procedure AdvToolBar31Click(Sender: TObject);
    procedure AdvToolBar32Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FMain2: TFMain2;

implementation

{$R *.dfm}



procedure TFMain2.AdvToolBar10Click(Sender: TObject);
begin
  FInsurance.Show;
end;

procedure TFMain2.AdvToolBar11Click(Sender: TObject);
begin
  FWard.Show;
end;

procedure TFMain2.AdvToolBar12Click(Sender: TObject);
begin
  FRooms.Show;
end;

procedure TFMain2.AdvToolBar13Click(Sender: TObject);
begin
  FAddClassCareInsurance.Show;
end;

procedure TFMain2.AdvToolBar14Click(Sender: TObject);
begin
  FAddCareTypeMesurement.Show;
end;

procedure TFMain2.AdvToolBar15Click(Sender: TObject);
begin
  FAddDischargeType.Show;
end;

procedure TFMain2.AdvToolBar16Click(Sender: TObject);
begin
  FAddItem.Show;
end;

procedure TFMain2.AdvToolBar17Click(Sender: TObject);
begin
  FAssignCoefToItem.Show;
end;

procedure TFMain2.AdvToolBar18Click(Sender: TObject);
begin
  FAssignItemInusrancePricing.Show;
end;

procedure TFMain2.AdvToolBar19Click(Sender: TObject);
begin
  FAddDoctorPerc.Show;
end;

procedure TFMain2.AdvToolBar1Click(Sender: TObject);
begin
  FAddPerson.Show;
end;

procedure TFMain2.AdvToolBar20Click(Sender: TObject);
begin
  FAddLabItem.Show;
end;

procedure TFMain2.AdvToolBar21Click(Sender: TObject);
begin
  FLabTestRequest.Show;
end;

procedure TFMain2.AdvToolBar22Click(Sender: TObject);
begin
  FTestPricing.Show;
end;

procedure TFMain2.AdvToolBar23Click(Sender: TObject);
begin
  FAddCoef.Show;
end;

procedure TFMain2.AdvToolBar24Click(Sender: TObject);
begin
  FAddCategory.Show;
end;

procedure TFMain2.AdvToolBar25Click(Sender: TObject);
begin
  FItemInsuranceCoverage.Show;
end;

procedure TFMain2.AdvToolBar26Click(Sender: TObject);
begin
  FTest.Show;
end;

procedure TFMain2.AdvToolBar27Click(Sender: TObject);
begin
  FCurrencies.Show;
end;

procedure TFMain2.AdvToolBar28Click(Sender: TObject);
begin
  FLabTestResult.Show;
end;

procedure TFMain2.AdvToolBar29Click(Sender: TObject);
begin
  FRadiologyRequest.Show;
end;

procedure TFMain2.AdvToolBar2Click(Sender: TObject);
begin
  FAddPatient.Show;
end;

procedure TFMain2.AdvToolBar30Click(Sender: TObject);
  var
    encounterNR : String;
    idFound : Boolean;
begin
  repeat
    encounterNR := InputBox('Encounter', 'Please enter the Encounter Number', '');
    idFound :=  DMPerson.care_encounter.Locate('encounter_nr',encounterNR, []);
  until idFound = True;
  DMSettings.encounter_item_lab.ParamByName('a').Value := encounterNR;
  DMSettings.encounter_item_lab.Execute;
  DMSettings.encounter_item_pharmacy.ParamByName('a').Value := encounterNR;
  DMSettings.encounter_item_pharmacy.Execute;
  DMSettings.encounter_item_radio.ParamByName('a').Value := encounterNR;
  DMSettings.encounter_item_radio.Execute;


  DMSettings.his_pharmacy_price.Refresh;
  DMSettings.his_lab_price.Refresh;
  DMSettings.his_radio_price.Refresh;
  Self.ReInvoice.ShowReport();

end;

procedure TFMain2.AdvToolBar31Click(Sender: TObject);
  var
    batchNR : String;
    idFound : Boolean;
begin
  repeat
    batchNR := InputBox('Radiology Batch Nr', 'Please enter the Radiology Batch Number', '');
    idFound :=  DMLab.his_test_request_radio.Locate('his_test_request_radio_id',batchNR, []);
  until idFound = True;
  FRadiologyTestResult.Show();
end;

procedure TFMain2.AdvToolBar32Click(Sender: TObject);
begin
  ReEncounter.ShowReport();
end;

procedure TFMain2.AdvToolBar33Click(Sender: TObject);
begin
  FItemAssignToPatient.Show;
end;

procedure TFMain2.AdvToolBar34Click(Sender: TObject);
begin
  FPharmacyStock.Show;
end;

procedure TFMain2.AdvToolBar35Click(Sender: TObject);
begin
  FPharmacyInvoice.Show;
end;

procedure TFMain2.AdvToolBar36Click(Sender: TObject);
begin
  FPharmacyTransaction.Show;
end;

procedure TFMain2.AdvToolBar37Click(Sender: TObject);
begin
  FPharmacyOptions.Show;
end;

procedure TFMain2.AdvToolBar3Click(Sender: TObject);
begin
  FAddPersonell.Show;
end;

procedure TFMain2.AdvToolBar4Click(Sender: TObject);
begin
  FDoctorList.Show;
end;

procedure TFMain2.AdvToolBar5Click(Sender: TObject);
begin
  FNurseList.Show;
end;

procedure TFMain2.AdvToolBar6Click(Sender: TObject);
begin
  FNursingWards.Show;
end;

procedure TFMain2.AdvToolBar7Click(Sender: TObject);
begin
  FAddPersonRole.Show;
end;

procedure TFMain2.AdvToolBar8Click(Sender: TObject);
begin
  FAddTestType.Show;
end;

procedure TFMain2.AdvToolBar9Click(Sender: TObject);
begin
  FDepartement.Show;
end;

end.
